package com.bw.paper.mvp.view.Fragment.news.Adapter;

import android.widget.TextView;

import com.bw.paper.R;
import com.bw.paper.entity.CommentEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.tb.emoji.EmojiUtil;

import org.jetbrains.annotations.NotNull;

import java.io.IOException;

public class CommentAdapter extends BaseQuickAdapter<CommentEntity.Values, BaseViewHolder> {
    public CommentAdapter() {
        super(R.layout.item_comment);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, CommentEntity.Values values) {
        baseViewHolder.setText(R.id.comment_item_fabulous_tv,""+values.comment_fabulous);
        baseViewHolder.setText(R.id.comment_item_name_tv,""+values.user_id);
        baseViewHolder.setText(R.id.comment_item_time_tv,""+values.comment_time);
        baseViewHolder.setText(R.id.comment_item_address_tv,values.comment_address);
//        baseViewHolder.setText(R.id.comment_item_values_tv,values.comment_value);
        TextView comment_item_values_tv = baseViewHolder.getView(R.id.comment_item_values_tv);
        try {
            EmojiUtil.handlerEmojiText(comment_item_values_tv, values.comment_value, getContext());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}